package com.study.order.fillhandle;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author caoqianhuan
 * @date 2022/8/23
 * @Description:
 */
//@Component
public class CreateFillHandle1 implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        this.strictInsertFill(metaObject, "createTime", () -> LocalDateTime.now().plusDays(1), LocalDateTime.class);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.insertFill(metaObject);
    }
}
